﻿'========================================================================
'功能:連絡資訊資料庫存取物件
'作者:andy
'日期: 2011/9/7
'========================================================================

Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.Data.SqlClient
Imports System.Text
Imports System.Data


Namespace WorkFlow.DAO
    Public Class WFInfoDAO
        Inherits OAMS.DAO.BaseDAO

        Dim _dbName As String
        Public Sub New(ByVal dbName As String)
            _dbName = dbName
        End Sub




        ''' <summary>
        ''' 
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Function GetInfoData() As DataTable

            Dim sb As New StringBuilder()
            sb.AppendLine(" select *  ")
            sb.AppendLine(" from  WF_Info   ")
            Return SqlHelper.ExecuteDataset(MyConn(_dbName), CommandType.Text, sb.ToString()).Tables(0)
        End Function


        ''' <summary>
        ''' 
        ''' </summary>
        ''' <remarks></remarks>
        Public Sub SetCreasysInfoData(ByVal CreasysInfo As String, ByVal UID As String)
            Dim sqlParams As SqlParameter() = New SqlParameter(1) {}

            sqlParams(0) = New SqlParameter("@CreasysInfo", SqlDbType.NVarChar)
            sqlParams(0).Value = CreasysInfo
            sqlParams(1) = New SqlParameter("@UID", SqlDbType.NVarChar)
            sqlParams(1).Value = UID
            Dim sb As New StringBuilder()
            sb.AppendLine(" Update  WF_Info   set CreasysInfo=@CreasysInfo,ModiUID=@UID ,ModiDate=Getdate()")
            SqlHelper.ExecuteDataset(MyConn(_dbName), CommandType.Text, sb.ToString(), sqlParams)
        End Sub

        ''' <summary>
        ''' 
        ''' </summary>
        ''' <remarks></remarks>
        Public Sub SetUserInfoData(ByVal UserInfo As String, ByVal UID As String)
            Dim sqlParams As SqlParameter() = New SqlParameter(1) {}

            sqlParams(0) = New SqlParameter("@UserInfo", SqlDbType.NVarChar)
            sqlParams(0).Value = UserInfo
            sqlParams(1) = New SqlParameter("@UID", SqlDbType.NVarChar)
            sqlParams(1).Value = UID
            Dim sb As New StringBuilder()
            sb.AppendLine(" Update  WF_Info   set UserInfo=@UserInfo,ModiUID=@UID ,ModiDate=Getdate()")
            SqlHelper.ExecuteDataset(MyConn(_dbName), CommandType.Text, sb.ToString(), sqlParams)
        End Sub
    End Class


End Namespace


